from fastapi import APIRouter, Depends

from app.api.admin.schema.client.client import ClientChangeStatusSchema, ClientListInSchema
from app.api.admin.service.client.client import ClientService
from app.utils.res import unified_resp


client = APIRouter(prefix="/client")


@client.post("/list")
@unified_resp
async def list(client_in: ClientListInSchema, client_service: ClientService = Depends(ClientService.instance)):
    return await client_service.list(client_in)


@client.post("/change_status")
@unified_resp
async def change_status(client_in: ClientChangeStatusSchema, client_service: ClientService = Depends(ClientService.instance)):
    return await client_service.change_status(client_in)
